package com.xiaofan.controller;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.xiaofan.bean.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.util.Date;

/**
 * @author: 晓帆
 * @description:
 * @create: 2021-07-01 09:50
 **/
@RestController
@RequestMapping("user")
public class UserController {
    @RequestMapping("quick")
    @ResponseBody
    public void say(@RequestParam("name") String username,String password){

    }
    @ResponseBody
    @RequestMapping(value = "header",headers = {"aaa","bbb"})
    public User say1(String username, String password){
        User user = new User();
        user.setUsername("zs");
        return user;
    }


    @ResponseBody
    @RequestMapping(value = "aaa")
    public User say2(Date birthday){
        User user = new User();
        System.out.println(birthday);
        user.setUsername("zs");
        return user;
    }

    @ResponseBody
    @RequestMapping(value = "upload")
    public void say3(MultipartFile myfile){

    }


}
